classdef ZAlgorithmable <  BatHandle
    %ZALGORITHMABLE Interface of having `this.zAlgorithm`
    %   Detailed explanation goes here
    
    properties ( SetAccess = protected )
        zAlgorithm
    end
    
    methods % Set methods
        function [  ] = setZAlgorithm( this, zAlgorithm, id )
            %SETZALGORITHM Set `this.zAlgorithm`
            %   Detailed explanation goes here
            % ZAlgorithmable::
            
            if nargin == 1
                this.zAlgorithm = {};
                return
            end
            if nargin == 2
                assert(isempty(zAlgorithm) || isa(zAlgorithm{1}, 'Algorithm'))
                this.zAlgorithm = zAlgorithm;
                return
            end
            if nargin == 3
                assert((id - 1) <= length(this.zAlgorithm))
                assert(isa(zAlgorithm, 'Algorithm'))
                this.zAlgorithm{id} = zAlgorithm;
                return
            end
        end
    end
    
    methods
        function  [ this ] = ZAlgorithmable(  )
            this.setZAlgorithm({});
        end
    end
    
end

